import 'dart:io';

import 'package:dio/dio.dart' hide Headers;
import 'package:example/data/bean/base_response.dart';
import 'package:example/data/bean/upload_img.dart';
import 'package:retrofit/retrofit.dart';

part 'oss_service.g.dart';

@RestApi()
abstract class OssService {
  factory OssService(Dio dio, {String baseUrl}) = _OssService;

  /// file 上传文件
  @POST("/common/batchUpload")
  @MultiPart()
  Future<BaseResponse<UploadImg>> uploadOss(
    @Part(name: "files") List<File> files,
    @Part() int? type,
  );
  /// file 上传文件
  @POST("/laas/common/upload")
  @MultiPart()
  Future<BaseResponse<ImgUrl?>> uploadAvatar(
    @Part(name: "file") File file,
      @Query("type") int type,
  );
}
